﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;
using PalFramework.Manager;

namespace PalBattleEmulator.Manager.Resource
{
    public class SingleFrameImageManager : FrameImageManager
    {

        public SingleFrameImageManager(string directory, string fileFormat, bool preload)
            : base(directory, fileFormat, preload)
        {
        }

        private string getKey(int id)
        {
            return String.Format("{0}", id);
        }

        public ImageSource GetImage(int id)
        {
            string key = getKey(id);
            if (images.ContainsKey(key))
                return images[key];
            return loadImage(key);
        }
    }
}
